<script setup lang='ts'>
import { PureTableBar } from "@/components/RePureTableBar";
import { useSecuritiesSetSpv } from "./hooks/SecuritiesSetSpv";
const {
  columns,
  loading,
  dataList,
  pagination,
  handleSizeChange,
  handleCurrentChange,
  DialogVisible,
  EntryPlatform,
  projectList,
  CloseEntryPlatform,
  SubtimEntryPlatform,
  changePro,
  check,
  showDetail,
} = useSecuritiesSetSpv()
</script>
<template>
  <div class="main">
    <PureTableBar title="资产证券化列表" class="list_hei">
      <template #buttons>
        <el-button type="primary" @click="DialogVisible = true">设立SPV </el-button>
      </template>
      <template v-slot="{ size, checkList }">
        <pure-table border align-whole="center" showOverflowTooltip table-layout="auto" adaptive :loading="loading"
          size="small" :data="dataList" max-height="600" :columns="columns" :checkList="checkList"
          :pagination="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange"
          :header-cell-style="{
            background: 'var(--el-table-row-hover-bg-color)',
            color: 'var(--el-text-color-primary)'
          }">
          <template #operation="{ row }">
            <el-button type='primary' size="small" text @click="check(row)">
              查看详情
              <!-- 激活 -->
            </el-button>
          </template>
        </pure-table>
      </template>
    </PureTableBar>
  </div>

  <ReDialog :width="800" :height="500" :models="DialogVisible" @Closes="CloseEntryPlatform()">
    <template #header>
      <h2 style="text-align: center;">公司设立登记申请书</h2>
    </template>
    <template #main>
      <el-scrollbar height="420px">
        <!-- 入驻平台窗口 -->
        <el-form label-width="250px" ref="RefEntryPlatform" :model="EntryPlatform">
          <el-form-item label="资产证券化项目：">
            <el-select placeholder="请选择" v-model="EntryPlatform.assetPoolId" style="width:60%" :disabled="showDetail">
              <el-option v-for="item in projectList" :key="item.assetPoolId" :label="item.assetSecuritizationName"
                :value="item.assetPoolId" @click="changePro(item)" />
            </el-select>
          </el-form-item>
        </el-form>
        <table border="1" style="margin:0 auto;text-align: center;">
          <tr>
            <td width="140" height="40" align="center">名称</td>
            <td width="470" colspan="6">{{ EntryPlatform.projectName }}</td>
          </tr>
          <tr>
            <td height="40">住所</td>
            <td colspan="2" width="180">**** </td>
            <td colspan="2" width="125">
              邮政编码
            </td>
            <td colspan="2" width="175"> ****</td>
          </tr>
          <tr>
            <td height="40">法定代表人姓名</td>
            <td colspan="2" width="180"> ****</td>
            <td colspan="2" width="125">职务</td>
            <td colspan="2" width="175">**** </td>
          </tr>
          <tr>
            <td height="40">注册资本</td>
            <td colspan="2" width="180">{{ EntryPlatform.money }}元 </td>
            <td colspan="2" width="125">公司类型</td>
            <td colspan="2" width="175"> 有限责任公司</td>
          </tr>
          <tr>
            <td height="40">实收资本</td>
            <td colspan="2" width="180"> {{ EntryPlatform.money }}元 </td>
            <td colspan="2" width="125">出资方式</td>
            <td colspan="2" width="175">货币 </td>
          </tr>
          <tr>
            <td width="140" height="40" align="center">经营范围</td>
            <td width="470" colspan="6"> ****</td>
          </tr>
          <tr>
            <td width="140" height="40" align="center">营业期限</td>
            <td width="470" colspan="6">{{ EntryPlatform.BusinessDate }} </td>
          </tr>
          <tr>
            <td width="140" height="40" align="center">备案事项</td>
            <td width="470" colspan="6"> ****</td>
          </tr>
          <tr>
            <td colspan="7" align="center" style="padding:15px" height="100">
              <p>
                本公司依照《中华人民共和国公司法》、《中华人民共和国公司登记管理条例》设立，提交材料真实有效。谨此对真实性承担责任。
              </p>
              <div class="bottom">
                <div>
                  法定代表人签字：****
                </div>
                <div>
                  指定代表或委托代理人签字：****
                </div>
              </div>
              <div class="bottom">
                <div>
                  {{ EntryPlatform.NewDate }}
                </div>
                <div>
                  {{ EntryPlatform.NewDate }}
                </div>
              </div>
            </td>
          </tr>
        </table>
      </el-scrollbar>
    </template>
    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="SubtimEntryPlatform()" v-if="!showDetail"> 确定 </el-button>
        <el-button @click="CloseEntryPlatform()" v-if="!showDetail"> 取消 </el-button>
      </span>
    </template>
  </ReDialog>
</template>

<style scoped lang="scss">
@import url(@/style/CreditComm.scss);

th,
tr,
td {
  border: 1px solid #bab9b9;
  border-collapse: collapse;
}

table span {
  display: inline-block;
  width: 100px;
  text-align: right;
}

#time span {
  width: 30px;
}


:deep(.el-dialog__footer) {
  text-align: center;
}

:deep(.el-form-item__label) {
  font-weight: 700
}

.bottom {
  display: flex;
  justify-content: space-between;
  align-content: center;
}
</style>
